<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:a="http://www.w3.org/1999/html">
<head>
    <title>Thymeleaf的入门</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<!--输出hello数据-->
<p th:text="${hello}"></p>
<form th:action="@{/test/hello}">
    <button>提交按钮</button>
</form>

<table>
    <tr>
        <td>下标</td>
        <td>编号</td>
        <td>姓名</td>
        <td>住址</td>
    </tr>
    <tr th:each="user,userStat:${users}">
        <td>
            下标:<span th:text="${userStat.index}"></span>,
        </td>
        <td th:text="${user.id}"></td>
        <td th:text="${user.name}"></td>
        <td th:text="${user.address}"></td>
    </tr>
</table>

<div th:each="map,mapStat:${dataMap}">
    <div th:text="${map}"></div>
    key:<span th:text="${mapStat.current.key}"></span><br/>
    value:<span th:text="${mapStat.current.value}"></span><br/>
    ==============================================
</div>

<div th:each="nm,nmStat:${names}">
    <span th:text="${nmStat.count}"></span><span th:text="${nm}"></span>
    ==============================================
</div>

<div th:text="${#dates.format(now,'yyyy-MM-dd hh:ss:mm')}">
    ==============================================
</div>

<div>
    <span th:if="${age>10}">年龄大于10</span>
</div>

<button onclick="abc()">JavaScript</button>


</body>
<script th:inline="javascript">
    var hhh = [[${hello}]]
    function abc() {
        alert(hhh)
    }
</script>
</html>